package Day14;

/**
 * @Author kalista
 * @Description 匿名内部类区实现
 * @Date 2020/11/20  14:33
 **/
public class Test04 {
    public static void main(String[] args) {

        // 创建线程对象，采用匿名内部类的方法
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println("分支线程-----》" + i);
                }
            }
        });

        thread.start();
        for (int i = 0; i < 1000; i++) {
            System.out.println("主线程--------》" + i);
        }
    }
}
